import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @USER: Administrator
 * @DATE: 2024/9/15 上午9:37
 * @VERSION: 1.0.0
 */
public class LC2848 {
    public static void main(String[] args) {

    }

    public int numberOfPoints(List<List<Integer>> nums) {
        Set<Integer> set = new HashSet<>();
        for (List<Integer> num : nums) {
            for (int i =num.get(0); i <= num.get(1); i++) {
                set.add(i);
            }
        }

        return set.size();
    }

}
